Skip to content

feat(restore): add --verbose flag to restore_site command#549

Open
wustwyh wants to merge 3 commits into
frappe:developfrom
wustwyh:enh/restore-verbose-flag
Open

feat(restore): add --verbose flag to restore_site command#549
wustwyh wants to merge 3 commits into
frappe:developfrom
wustwyh:enh/restore-verbose-flag

Conversation

@wustwyh

@wustwyh wustwyh commented Jun 22, 2026

Copy link
Copy Markdown

Adds --verbose to the bench restore command so users can see progress during heavy backup restores instead of waiting with a single static message.

Also addresses the Greptile review note: add mock_execute.assert_called_once() before accessing call_args so a failure to reach bench_execute produces a clear assertion error rather than a confusing TypeError.

Closes #483.

Adds --verbose to the bench restore command so users can see progress
during heavy backup restores instead of waiting with a single static
message.

Closes frappe#483.
@mergify

mergify Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@wustwyh

wustwyh commented Jun 22, 2026 via email

Copy link
Copy Markdown
Author

@greptile-apps

greptile-apps Bot commented Jun 22, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

Safe to merge — the change is a one-line flag addition to a static command string with no conditional paths or data handling.

The entire production change is inserting the literal string --verbose into an existing concatenated command. No new logic, no new data flow, and the accompanying test correctly validates the flag is present. No regressions are expected.

No files require special attention.

Important Files Changed

Filename Overview
agent/site.py Adds "--verbose " to the bench restore command string; change is minimal, correct, and has no security or logic impact.
agent/tests/test_site.py New test correctly verifies --verbose presence; assert_called_once() placed before call_args access guards against silent non-calls.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant Caller
    participant restore_site
    participant bench_execute

    Caller->>restore_site: restore_site(mariadb_root_password, admin_password, ...)
    restore_site->>restore_site: build command string "--force restore --verbose ..."
    restore_site->>bench_execute: bench_execute(command)
    bench_execute-->>restore_site: result
    restore_site-->>Caller: result
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant Caller
    participant restore_site
    participant bench_execute

    Caller->>restore_site: restore_site(mariadb_root_password, admin_password, ...)
    restore_site->>restore_site: build command string "--force restore --verbose ..."
    restore_site->>bench_execute: bench_execute(command)
    bench_execute-->>restore_site: result
    restore_site-->>Caller: result
Loading

Reviews (3): Last reviewed commit: "Merge upstream develop into enh/restore-..." | Re-trigger Greptile

Comment thread agent/tests/test_site.py
wustwyh added 2 commits June 24, 2026 19:08
…args

Greptile review noted that accessing mock_execute.call_args without first
asserting the mock was called could mask a silent no-op if the code path
changes. Add assert_called_once() to produce a clear assertion error.

Refs frappe#549
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement]: Higher verbosity in backup restore job

1 participant